<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php echo $this->breadCrumbs(); ?>
  </div>
  <?php if (isset($error_warning)) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/customer.png" alt="" /> <?php echo $_['heading_title']; ?></h1>
      <div class="buttons">
      <a onclick="$('#form').submit();" class="button"><?php echo $_['button_save']; ?></a>
      <a onclick="location = '<?php echo UA('sale/customer_grade'); ?>';" class="button"><?php echo $_['button_cancel']; ?></a>
      </div>
    </div>
    <div class="content">
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
        <table class="form">
          <tr>
            <td><span class="required">*</span> <?php echo $_['text_name']; ?></td>
            <td><?php foreach ($languages as $language_id => $language) { ?>
              <input type="text" name="customer_grade_description[<?php echo $language_id; ?>][name]" value="<?php echo $vo->getL('customer_grade_description', $language_id, 'name'); ?>" />
              <img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /><br />
              <?php
				$e = 'error_name_' . $language['language_id'] ;
			    if (isset($$e)) { ?>
              <span class="error"><?php echo $$e; ?></span><br />
              <?php } ?>
              <?php } ?></td>
          </tr>
          <?php foreach ($languages as $language_id => $language) { ?>
          <tr>
            <td><?php echo $_['text_description']; ?></td>
            <td><textarea name="customer_grade_description[<?php echo $language_id; ?>][description]" cols="40" rows="5"><?php echo $vo->getL('customer_grade_description', $language_id, 'description'); ?></textarea>
              <img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" align="top" /></td>
          </tr>
          <?php } ?>
          <tr>
            <td><?php echo $_['text_grade_help']; ?></td>
            <td><input type="text" name="grade" value="<?php echo $vo->get('grade', 1); ?>" size="10" /></td>
          </tr>
		  <tr>
            <td><?php echo $_['text_min_points']; ?></td>
            <td><input type="text" name="min_points" value="<?php echo $vo->get('min_points'); ?>" size="10" /></td>
          </tr>
          <tr>
            <td><?php echo $_['text_max_points']; ?></td>
            <td><input type="text" name="max_points" value="<?php echo $vo->get('max_points'); ?>" size="10" /></td>
          </tr>
          <tr>
            <td><?php echo $_['text_sort_order']; ?></td>
            <td><input type="text" name="sort_order" value="<?php echo $vo->get('sort_order'); ?>" size="10" /></td>
          </tr>
        </table>
      </form>
    </div>
  </div>
</div>
<?php echo $footer; ?>